package org.vshe.improve.spring.prospring3.ch5;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;

@Configuration
public class AppConfig {
	@Bean
	@Lazy(value = true)
	public MessageProvider messageProvider() {
		return new ConfigurableMessageProvider();
	}
	
	@Bean
	public MessageRenderer messageRenderer() {
		MessageRenderer renderer = new StandardOutputMessageRenderer();
		renderer.setMessageProvider(messageProvider());
		return renderer;
	}
}
